package com.quanyan.scheduler.task.tracker;

import com.github.ltsopensource.core.domain.Action;
import com.github.ltsopensource.tasktracker.Result;
import com.github.ltsopensource.tasktracker.runner.JobContext;
import com.github.ltsopensource.tasktracker.runner.JobRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * Created by Administrator on 2016/6/29.
 */
@Component("jobRunnerB")
public class JobRunnerB implements JobRunner{

    private static final Logger LOGGER = LoggerFactory.getLogger(JobRunnerA.class);


    @Override
    public Result run(JobContext jobContext) throws Throwable {
        try {
            //TODO  执行业务逻辑

        } catch (Exception e) {
            LOGGER.info("Run job failed!", e);
            return new Result(Action.EXECUTE_LATER, "----JobRunnerB--task-execute-fail--->"+e.getMessage());
        }
        return new Result(Action.EXECUTE_SUCCESS, "--JobRunnerB---task-execute-success---");
    }
}
